package com.senriot.quickup.repository

import com.senriot.cloud.common.IRepository
import com.senriot.quickup.domain.Ad
import com.senriot.quickup.domain.QAd
import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer
import org.springframework.data.querydsl.binding.QuerydslBindings
import org.springframework.stereotype.Repository
import java.util.*

/**
 * Spring Data  repository for the [Role] entity.
 */
@Suppress("unused")
@Repository
interface AdRepository : IRepository<Ad, String>, QuerydslBinderCustomizer<QAd> {
    @JvmDefault
    override fun customize(bindings: QuerydslBindings, root: QAd) {
        bindings.bind(root.name).first { path, value -> path.containsIgnoreCase(value) }
        bindings.excluding(root.createdBy, root.createdDate, root.lastModifiedBy, root.lastModifiedDate)
    }
}
